package com.tledu.data.export.controller;


import com.tledu.data.export.service.ExportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@RequestMapping("/export")
public class ExportController {
    @Autowired
    private ExportService exportService;
    @GetMapping("/excel")
    public void exportExcel(@RequestParam String name,@RequestParam String starttime,@RequestParam String endtime, HttpServletResponse response) {
        try {
            System.out.println("controller接收到:"+name+" "+starttime+""+endtime);
            exportService.export(name, starttime, endtime,response);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
